package com.toune.movie.base.myview;

import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.siberiadante.customdialoglib.CustomDialog;
import com.toune.movie.R;

import xyz.zpayh.hdimage.HDImageView;

/**
 * Created by Administrator on 2018/5/18.
 */

public class LargeImageDialog extends CustomDialog {

    private String filePath;

    public LargeImageDialog(Context context, int layoutResID, String filePath) {
        super(context, layoutResID);
        this.filePath = filePath;
    }

    public LargeImageDialog(Context context, int layoutResID, int[] listenedItems) {
        super(context, layoutResID, listenedItems);
    }

    public LargeImageDialog(Context context, int layoutResID, int[] listenedItems, int animationResId) {
        super(context, layoutResID, listenedItems, animationResId);
    }

    public LargeImageDialog(Context context, int layoutResID, int[] listenedItems, boolean isDismiss) {
        super(context, layoutResID, listenedItems, isDismiss);
    }

    public LargeImageDialog(Context context, int layoutResID, int[] listenedItems, boolean isDismiss, boolean isDismissTouchOut) {
        super(context, layoutResID, listenedItems, isDismiss, isDismissTouchOut);
    }

    public LargeImageDialog(Context context, int layoutResID, int[] listenedItems, boolean isDismiss, int position) {
        super(context, layoutResID, listenedItems, isDismiss, position);
    }

    public LargeImageDialog(Context context, int layoutResID, int[] ids, int animationResId, boolean isDismiss, boolean isDismissTouchOut, int position) {
        super(context, layoutResID, ids, animationResId, isDismiss, isDismissTouchOut, position);
    }

    private View mView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mView = View.inflate(getContext(), R.layout.dialog_large_image, null);
        setContentView(mView);
        HDImageView mImageView = (HDImageView) findViewById(R.id.image);

        mImageView.setImageURI(filePath);
        mImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
